home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / pascal / tptc17sc.zip / STOUPPER.INC < prev    next >
Text File  |  1988-03-25  |  1KB  |  35 lines

  1.  
  2. (*--------------------------------------------------------
  3.  *   map string to upper case (tpas 4.0)
  4.  *)
  5.  
  6. {$F+} procedure stoupper(var st: string); {$F-}
  7. begin
  8.  
  9.    Inline(
  10.      $C4/$7E/$06/           {   les di,[bp]6         ;es:di -> st[0]}
  11.      $26/                   {   es:}
  12.      $8A/$0D/               {   mov cl,[di]          ;cl = length}
  13.      $FE/$C1/               {   inc cl}
  14.  
  15.                             {next:}
  16.      $47/                   {   inc di}
  17.      $FE/$C9/               {   dec cl}
  18.      $74/$12/               {   jz ends}
  19.  
  20.      $26/                   {   es:}
  21.      $8A/$05/               {   mov al,[di]}
  22.      $3C/$61/               {   cmp al,'a'}
  23.      $72/$F4/               {   jb next}
  24.      $3C/$7A/               {   cmp al,'z'}
  25.      $77/$F0/               {   ja next}
  26.  
  27.      $2C/$20/               {   sub al,' '}
  28.      $26/                   {   es:}
  29.      $88/$05/               {   mov [di],al}
  30.      $EB/$E9);              {   jmp next}
  31.  
  32.                             {ends:}
  33. end;
  34.  
  35.